from rest_framework.serializers import ModelSerializer, Serializer

import users
from users.models import User
from users.serializers import UserInfoSerializer
from .models import Diss, Comment, Like


class FristPageSerializer(ModelSerializer):
    """吐槽首页,吐槽的序列化器"""
    class Meta:
        model = Diss
        fields = ["diss_content", "create_time", "diss_like", "share_count", "collect_count"]


class DissDetailSerializer(ModelSerializer):
    """吐槽详情页"""
    class Meta:
        model = Diss
        fields = ["id", "diss_content", "diss_like", "share_count", "publish"]


class DisscommentSerializer(ModelSerializer):
    """吐槽评论页"""

    class Meta:
        model = Comment
        fields = "__all__"


